package m.jclecai.com.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

import m.jclecai.com.MyApplication;
import m.jclecai.com.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DialogTwoBtn extends Dialog {
	@BindView(R.id.tv_msg_title)
	public TextView tv_msg_title;
	@BindView(R.id.message)
	public TextView message;
	@BindView(R.id.left_btn)
	public TextView left_btn;
	@BindView(R.id.right_btn)
	public TextView right_btn;
	@BindView(R.id.ll_tips)
	LinearLayout ll_tips;


	private Context context;
	public View.OnClickListener left_Ocl;
	public View.OnClickListener right_Ocl;

	public DialogTwoBtn(Context paramContext) {
		super(paramContext);
	}

	public DialogTwoBtn(Context paramContext, int paramInt) {
		super(paramContext, paramInt);
		this.context = paramContext;
	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		setContentView(R.layout.dialog_twobtn_view);
		ButterKnife.bind(this);
	}

	public void setLeft_Ocl(View.OnClickListener paramOnClickListener) {
		this.left_btn.setOnClickListener(paramOnClickListener);
	}

	public void setLeft_btn(String paramString) {
		this.left_btn.setText(paramString);
	}

	public void setMessage(String paramString) {
		this.message.setText(paramString);
	}

	public void setMsgTitle(String paramString) {
		this.tv_msg_title.setText(paramString);
	}

	public void setTipsVisible(boolean tipsVisible){
		ll_tips.setVisibility(tipsVisible? View.VISIBLE: View.GONE);
	}

	public void setRight_Ocl(View.OnClickListener paramOnClickListener) {
		this.right_btn.setOnClickListener(paramOnClickListener);
	}

	public void setRight_btn(String paramString) {
		this.right_btn.setText(paramString);
	}

	public void show() {
		super.show();
		int width = MyApplication.getInstance().displayWith;
		WindowManager.LayoutParams localLayoutParams = getWindow()
				.getAttributes();
		localLayoutParams.width = width;
		getWindow().setAttributes(localLayoutParams);
	}
}

